#pragma once

/**
* Enumeration with the supported types.
*/
enum PRIMITIVE{LINES,TRIANGLES};

/**
* Base class for indexed geometry. This class is a wrapper around
* the IndexBuffer concept.
* @author Koen Samyn
*/

class Device3D;
class IndexedGeometry
{
public:
	/**
	* Creates a new IndexedGeometry object.
	*/
	IndexedGeometry(void);
	/**
	* Destroys the IndexedGeometry object.
	*/
	virtual ~IndexedGeometry(void);
	/**
	* Returns the type of primitive.
	* @return the primitive type.
	*/
	virtual PRIMITIVE GetPrimitiveType()=0;
	/**
	* Checks if the index is valid.
	* @param index the index to check.
	*/
	void CheckIndex(int index);
	/**
	* Returns the maximum index.
	* @return the maximum index.
	*/
	int GetMaxIndex();
	/**
	* Returns the minimu index.
	* @return the minimum index.
	*/
	int GetMinIndex();
	/**
	* Returns the number of vertices that were referenced.
	* @return the number of vertices.
	*/
	int GetVertexCount();
	/**
	* Add an index to the list of indices.
	* @param index the index to add.
	*/
	virtual void AddIndex(int index);
	/**
	* Gets the size in bytes of this indexed geometry.
	* @return the size in bytes.
	*/
	virtual unsigned int GetSizeInBytes()=0;
	/**
	* Gets a pointer to the internal data.
	*/
	virtual void* GetData()=0;
	/**
	* Returns the number of primitives to render.
	* @return the number of primitives.
	*/
	virtual int GetNumberOfPrimitives()=0;
private:
	/**
	* Stores the current maximum index.
	*/
	int m_MaxIndex;
	/**
	* Stores the current minimum index.
	*/
	int m_MinIndex;
	/**
	* Stores the current vertex count.
	*/
	int m_VertexCount;

	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	IndexedGeometry(const IndexedGeometry& t);
	IndexedGeometry& operator=(const IndexedGeometry& t);
};
